﻿using System;
using System.Collections;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Windows.Forms;
using System.Xml;
using Aulac.Rsc.Bss.Tags;
using Aulac.Rsc.Bss;

namespace Aulac.Client.Controls.Bss
{
	/// <summary>
	/// Summary description for MdnItemCtrl.
	/// </summary>
    [System.ComponentModel.ToolboxItem(true)]
    
    public partial class ComboCapAssGrp : Aulac.Client.Controls.UserControls.ComboTableCtrl
    {
        public ComboCapAssGrp()
		{
			InitializeComponent();
            OnInit();
        }

        #region Overrides
        protected override void OnFormLoad()
        {
            if (DesignMode) return;
            AutoLoadData = true;
            OnInit();
        }
        protected override void OnInit()
        {
            this.cboData.ColumnNames = string.Format("{0}, {1}", tagItems.CapAssGrp.CapAssGrpID, tagItems.CapAssGrp.CapAssGrpName);
            this.cboData.DisplayMember = tagItems.CapAssGrp.CapAssGrpID;
            this.cboData.FieldMember = tagItems.CapAssGrp.CapAssGrpPrkID;
            this.cboData.ValueMember = tagItems.CapAssGrp.CapAssGrpPrkID;
            this.cboData.ListFieldMember = string.Format("{0}, {1}", tagItems.CapAssGrp.CapAssGrpID, tagItems.CapAssGrp.CapAssGrpName);
            this.cboData.LinkedColumnName = tagItems.CapAssGrp.CapAssGrpName;
        }
        protected override void OnSetDataSource(out object pDataSource, out string pTableName)
        {
            pDataSource = new Aulac.Client.Data.Bss.DataSet.Catalog.Dm_CapAssGrpDataTable();
            pTableName = TableNames.Dm_CapAssGrp;
        }
        protected override void OnAddParamsQuery()
        {
            //AddParamQuery(tagItems.CapAss.IsActive, tagItems.Icd.IsActive, DbType.Boolean, 1);
        }
        #endregion

        #region Properties
        [Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
        public string CapAssGrpID
        {
            get
            {
                return cboData.GetValueItem(tagItems.CapAssGrp.CapAssGrpID);
            }
            set
            {
                int index = cboData.FindItem(value, tagItems.CapAssGrp.CapAssGrpID);
                if (index >= 0)
                    cboData.SelectedIndex = index;
                else
                    cboData.SelectedIndex = -1;
            }
        }
        [Browsable(false), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
        public string CapAssGrpPrkID
        {
            get
            {
                return cboData.GetValueItem(tagItems.CapAssGrp.CapAssGrpPrkID);
            }
            set
            {
                int index = cboData.FindItem(value, tagItems.CapAssGrp.CapAssGrpPrkID);
                if (index >= 0)
                    cboData.SelectedIndex = index;
                else
                    cboData.SelectedIndex = -1;
            }
        }
        public string CapAssGrpName
        {
            get
            {
                if (cboData.IsEmpty)
                    return "";
                return cboData.GetValueItem(tagItems.CapAssGrp.CapAssGrpName);
            }

        }
        #endregion

        #region Methods

        #endregion
    }
}
